money = 10000
year = 0
while money < 20000:
    year += 1
    #获得本年利息
    interest = int(money * 0.05)
    print(f"第{year}年:本金:{money}利息:{interest},总共{money+interest}")
    #获得本年的本金+利息
    money = money + interest
print(f"达到20000元,需要{year}年")